import { useGLTF } from "@react-three/drei";
import { RigidBody } from "@react-three/rapier";

export default function PhysicFloor({ path }: { path: string }) {
  const { scene } = useGLTF(path);
  scene.traverse((child) => {
    child.raycast = () => null;
  });
  return (
    <group dispose={null} visible={false}>
      <RigidBody name="环境" type="fixed" colliders="trimesh">
        <primitive object={scene} position={[0, -0.1, 0]} />
      </RigidBody>
    </group>
  );
}
